package com.qffx.moviebase.utils.retrofit;


import com.qffx.moviebase.utils.DiscoverURL;

import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
import retrofit2.converter.scalars.ScalarsConverterFactory;

/**
 * Created by 韩爽 on 2017/2/7.
 */

public class HttpClient {
    public static HttpService getService(){
        Retrofit retrofit=new Retrofit.Builder()
                .baseUrl("http://www.moviebase.cn/")
                .addConverterFactory(ScalarsConverterFactory.create())
                .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
                .build();
        return  retrofit.create(HttpService.class);
    }

    public static HttpService getFindService() {
        Retrofit retrofit = new Retrofit.Builder()
                .baseUrl(DiscoverURL.BaseUrl)
                .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
                .addConverterFactory(GsonConverterFactory.create())
                .build();


        return  retrofit.create(HttpService.class);

    }
    public static HttpService getFindMovie(){
        Retrofit retrofit=new Retrofit.Builder()
                .baseUrl(DiscoverURL.BaseUrl)
                .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
                .addConverterFactory(GsonConverterFactory.create())
                .build();
        return retrofit.create(HttpService.class);
    }
}
